Reference paper: https://arxiv.org/pdf/1106.5162.pdf
from agilepy.api.AGAnalysis import AGAnalysis
# Interactive plots
#%matplotlib widget
confFilePath = "$HOME/agilepy_conf.yaml"
AGAnalysis.getConfiguration(
confFilePath = confFilePath,
evtfile="$AGILE/agilepy-test-data/test_dataset_agn/EVT/EVT.index",
logfile="$AGILE/agilepy-test-data/test_dataset_agn/LOG/LOG.index",
userName = "username",
sourceName = "3C454_3",
tmin = 55513.0,
tmax = 55521.0,
timetype = "MJD",
glon = 86.11,
glat = -38.18,
outputDir = "$HOME/agilepy_analysis",
verboselvl = 0
)
ag = AGAnalysis(confFilePath)
#print all options of the configuration file
ag.setOptions(binsize=0.5, expstep=2, mapsize=25)
ag.setOptions(energybins=[[100, 50000]])
ag.printOptions()
{ 'ap': {'radius': 3, 'timeslot': 3600},
'input': { 'evtfile': '/Users/bulgarelli/opt/anaconda3/envs/agilepydev/agiletools/agilepy-test-data/test_dataset_agn/EVT/EVT.index',
'logfile': '/Users/bulgarelli/opt/anaconda3/envs/agilepydev/agiletools/agilepy-test-data/test_dataset_agn/LOG/LOG.index'},
'maps': { 'binsize': 0.5,
'energybins': [[100, 50000]],
'expstep': 2,
'fovbinnumber': 1,
'mapsize': 25,
'offaxisangle': 30,
'proj': 'ARC',
'projtype': 'WCS',
'spectralindex': 2.1,
'timestep': 160,
'useEDPmatrixforEXP': False},
'mle': { 'contourpoints': 40,
'edpcorrection': 0.75,
'expratio_maxthr': 15,
'expratio_minthr': 0,
'expratio_size': 10,
'expratioevaluation': True,
'fluxcorrection': 0,
'integratortype': 1,
'loccl': 5.99147,
'mindefaulttolerance': 0.01,
'minimizeralg': 'Migrad',
'minimizerdefstrategy': 2,
'minimizertype': 'Minuit',
'ranal': 10,
'ulcl': 2},
'model': { 'emax_sources': 10000,
'emin_sources': 100,
'galcoeff': [-1],
'galmode': 1,
'galmode2': 0,
'galmode2fit': 0,
'isocoeff': [-1],
'isomode': 1,
'isomode2': 0,
'isomode2fit': 0,
'modelfile': None},
'output': { 'filenameprefix': 'analysis_product',
'logfilenameprefix': 'analysis_log',
'outdir': PosixPath('/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417'),
'sourcename': 'username',
'username': '3C454_3',
'verboselvl': 0},
'plotting': {'twocolumns': False},
'selection': { 'albedorad': 80,
'bpointing': None,
'dq': 0,
'emax': 10000,
'emin': 100,
'filtercode': 5,
'fovradmax': 60,
'fovradmin': 0,
'glat': -38.18,
'glon': 86.110001,
'lonpole': 180,
'lpointing': None,
'maplistgen': 'None',
'phasecode': 6,
'proj': 'ARC',
'timelist': 'None',
'timetype': 'TT',
'tmax': 217382400.0,
'tmin': 216691200.0}}
sources = ag.loadSourcesFromCatalog("2AGL", rangeDist = (0, 5), show=True)
----------------------------------------------------------- Source name: 2AGLJ2247+1558 (PointSource) * Free parameters: none * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 6.05327e-08 - index: 2.75651 - Source position: (84.2229, -37.4782) (l,b) - Distance from map center: 1.6474 deg ----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) * Free parameters: none * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 7.50937e-07 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg
#newSourceDict = {
# "glon" : 86.11,
# "glat": -38.18,
# "spectrumType" : "PowerLaw",
# "flux": 100e-08,
# "index": 2.1
#}
#s = ag.addSource("CYGX3", newSourceDict)
#print(s)
Selection params = [name, dist, flux, sqrtts]
deletedSources = ag.deleteSources('flux <= 10e-08', show = True)
----------------------------------------------------------- Source name: 2AGLJ2247+1558 (PointSource) * Free parameters: none * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 6.05327e-08 - index: 2.75651 - Source position: (84.2229, -37.4782) (l,b) - Distance from map center: 1.6474 deg
sources = ag.selectSources("flux > 0", show = True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) * Free parameters: none * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 7.50937e-07 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg
Freeable params = [flux, index, index1, index2, cutoffEnergy, pivotEnergy, curvature, pos]
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "flux", True, show=True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) * Free parameters: flux * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 7.50937e-07 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg
In this example, only one source is affected.
#Generate maps
maplistfile = ag.generateMaps()
Generating maps..please wait.
! cat $maplistfile
/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/maps/0/analysis_product_TN216691200.0_TX217382400.0_EN00100_EX50000_ID01.cts.gz /Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/maps/0/analysis_product_TN216691200.0_TX217382400.0_EN00100_EX50000_ID01.exp.gz /Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/maps/0/analysis_product_TN216691200.0_TX217382400.0_EN00100_EX50000_ID01.gas.gz 30 -1 -1
#Display counts map
ag.displayCtsSkyMaps(maplistFile=maplistfile, smooth=3, catalogRegions="2AGL", catalogRegionsColor="green")
Generating plot..please wait. 2021-03-25 09:04:34,223 [WARNING ] [AGAnalysis] singleMode has been turned off because only one map is going to be displayed.
[None]
#Display exposure map
ag.displayExpSkyMaps()
Generating plot..please wait. 2021-03-25 09:04:35,303 [WARNING ] [AGAnalysis] singleMode has been turned off because only one map is going to be displayed.
[None]
#Display diffuse emission map
ag.displayGasSkyMaps()
Generating plot..please wait. 2021-03-25 09:04:35,554 [WARNING ] [AGAnalysis] singleMode has been turned off because only one map is going to be displayed.
[None]
#Fix the diffuse emission coefficient to a default value.
ag.setOptions(galcoeff=[0.7])
#! cat $maplistfile
ag.printOptions("model")
{ 'emax_sources': 10000,
'emin_sources': 100,
'galcoeff': [0.7],
'galmode': 1,
'galmode2': 0,
'galmode2fit': 0,
'isocoeff': [-1],
'isomode': 1,
'isomode2': 0,
'isomode2fit': 0,
'modelfile': None}
#calculate a mean value of isotropic and diffuse emission coefficients.
#gal,iso,maplist = ag.calcBkg("2AGLJ2254+1609", galcoeff = [0.7], pastTimeWindow = 0)
#print(iso)
#! cat $maplistfile
#ag.printOptions("model")
#Perform a maximum likelihood estimator
ag.mle()
['/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/mle/0/analysis_product_2AGLJ2254+1609.source']
#Display the results
ag.selectSources("sqrtTS > 0", show=True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 35.6874 * Free parameters: flux * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 7.50937e-07 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 2.69452e-05 +/- 1.31157e-06 - index: 2.20942 - upper limit(ph/cm2s): 2.96345e-05 - ergLog(erg/cm2s): 4.31986e-09 +/- 2.10272e-10 - galCoeff: [0.7] - isoCoeff: [9.39942] +/- [0.464855] - exposure(cm2s): 27077100.0 - exp-ratio: 0.0 - L_peak: 86.1236 - B_peak: -38.1824 - Distance from start pos: 0.0 - position: - L: -1.0 - B: -1.0 - Distance from start pos: -1.0 - radius of circle: -1.0 - ellipse: - a: -1.0 - b: -1.0 - phi: -1.0 -----------------------------------------------------------
[<agilepy.core.SourceModel.Source at 0x7fa18070a7d0>]
lightCurveData = ag.lightCurveMLE("2AGLJ2254+1609", binsize=86400)
Computing light curve bins..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
cat $lightCurveData
time_start_mjd time_end_mjd sqrt(ts) flux flux_err flux_ul gal gal_error iso iso_error l_peak b_peak dist_peak l b r ell_dist a b phi exposure ExpRatio counts counts_err Index Index_Err Par2 Par2_Err Par3 Par3_Err Erglog Erglog_Err Erglog_UL time_start_utc time_end_utc time_start_tt time_end_tt Fix index ULConfidenceLevel SrcLocConfLevel start_l start_b start_flux typefun par2 par3 galmode2 galmode2fit isomode2 isomode2fit edpcor fluxcor integratortype expratioEval expratio_minthr expratio_maxthr expratio_size Emin emax fovmin fovmax albedo binsize expstep phasecode 55513.0 55514.0 4.16833 530.195e-08 198.99e-08 994.851e-08 0.7 0.0 11.746 0.447796 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3438060.0 0.0 18.2284 6.84138 2.20942 0.0 0.0 0.0 0.0 0.0 8.50011e-10 3.19021e-10 1.59495e-09 2010-11-13T00:00:00 2010-11-14T00:00:00 216691200.0 216777600.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55514.0 55515.0 4.82266 641.751e-08 200.632e-08 1101.15e-08 0.7 0.0 7.14061 0.465488 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3493990.0 0.0 22.4227 7.01005 2.20942 0.0 0.0 0.0 0.0 0.0 1.02886e-09 3.21654e-10 1.76537e-09 2010-11-14T00:00:00 2010-11-15T00:00:00 216777600.0 216864000.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55515.0 55516.0 5.342 776.071e-08 233.124e-08 1306.88e-08 0.7 0.0 13.8934 0.453025 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3447230.0 0.0 26.753 8.03632 2.20942 0.0 0.0 0.0 0.0 0.0 1.2442e-09 3.73746e-10 2.0952e-09 2010-11-15T00:00:00 2010-11-16T00:00:00 216864000.0 216950400.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55516.0 55517.0 5.1785 857.576e-08 249.524e-08 1416.38e-08 0.7 0.0 14.2165 0.49501 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3579240.0 0.0 30.6947 8.93109 2.20942 0.0 0.0 0.0 0.0 0.0 1.37487e-09 4.00039e-10 2.27076e-09 2010-11-16T00:00:00 2010-11-17T00:00:00 216950400.0 217036800.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55517.0 55518.0 13.0059 3941.96e-08 551.809e-08 5127.93e-08 0.7 0.0 5.34734 0.509593 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 2153790.0 0.0 84.9018 11.8848 2.20942 0.0 0.0 0.0 0.0 0.0 6.31978e-09 8.84664e-10 8.22112e-09 2010-11-17T00:00:00 2010-11-18T00:00:00 217036800.0 217123200.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55518.0 55519.0 19.1742 4890.98e-08 442.567e-08 5820.65e-08 0.7 0.0 5.24724 0.455424 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3789410.0 0.0 185.339 16.7707 2.20942 0.0 0.0 0.0 0.0 0.0 7.84125e-09 7.09526e-10 9.3317e-09 2010-11-18T00:00:00 2010-11-19T00:00:00 217123200.0 217209600.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55519.0 55520.0 18.5461 4824.94e-08 467.927e-08 5810.48e-08 0.7 0.0 13.3216 0.465016 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3687280.0 0.0 177.909 17.2538 2.20942 0.0 0.0 0.0 0.0 0.0 7.73537e-09 7.50184e-10 9.3154e-09 2010-11-19T00:00:00 2010-11-20T00:00:00 217209600.0 217296000.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55520.0 55521.0 19.2164 4847.01e-08 461.471e-08 5819.75e-08 0.7 0.0 6.74551 0.445716 86.1236 -38.1824 0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3475880.0 0.0 168.476 16.0402 2.20942 0.0 0.0 0.0 0.0 0.0 7.77075e-09 7.39833e-10 9.33026e-09 2010-11-20T00:00:00 2010-11-21T00:00:00 217296000.0 217382400.0 1.0 2.20942 2.0 5.99147 86.1236 -38.1824 2.69452e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0
print(lightCurveData)
/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/lc/0/light_curve_216691200_217382400.txt
ag.displayLightCurve("mle")
Generating plot..please wait.
lightCurveData = ag.lightCurveMLE("2AGLJ2254+1609", tmin=55513.0, tmax=55515.0, timetype="MJD", binsize=86400)
Computing light curve bins..please wait.
Generating maps..please wait.
Generating maps..please wait.
#cat $lightCurveData
ag.displayLightCurve("mle")
Generating plot..please wait.
ag.setOptionTimeMJD(55513.0, 55517.0)
ag.setOptions(energybins=[[100, 300], [300, 1000], [1000, 3000], [3000, 10000], [10000, 50000]])
ag.setOptions(galcoeff=[0.7, 0.7, 0.7, 0.7, 0.7])
ag.setOptions(isocoeff=[-1, -1, -1, -1, -1])
ag.printOptions("maps")
{ 'binsize': 0.5,
'energybins': [ [100, 300],
[300, 1000],
[1000, 3000],
[3000, 10000],
[10000, 50000]],
'expstep': 2,
'fovbinnumber': 1,
'mapsize': 25,
'offaxisangle': 30,
'proj': 'ARC',
'projtype': 'WCS',
'spectralindex': 2.1,
'timestep': 160,
'useEDPmatrixforEXP': False}
maplistfile = ag.generateMaps()
Generating maps..please wait.
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "index", True, show=True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 35.6874 * Free parameters: flux index * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 7.50937e-07 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 2.69452e-05 +/- 1.31157e-06 - index: 2.20942 - upper limit(ph/cm2s): 2.96345e-05 - ergLog(erg/cm2s): 4.31986e-09 +/- 2.10272e-10 - galCoeff: [0.7] - isoCoeff: [9.39942] +/- [0.464855] - exposure(cm2s): 27077100.0 - exp-ratio: 0.0 - L_peak: 86.1236 - B_peak: -38.1824 - Distance from start pos: 0.0 - position: - L: -1.0 - B: -1.0 - Distance from start pos: -1.0 - radius of circle: -1.0 - ellipse: - a: -1.0 - b: -1.0 - phi: -1.0 -----------------------------------------------------------
ag.mle()
['/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/mle/1/analysis_product_2AGLJ2254+1609.source']
selectedSources = ag.selectSources('flux > 0', show=True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 10.2859 * Free parameters: flux index * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 2.69452e-05 +/- 1.31157e-06 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 8.75337e-06 +/- 1.62802e-06 - index: 2.51349 +/- 0.173183 - upper limit(ph/cm2s): 1.14728e-05 - ergLog(erg/cm2s): 1.40335e-09 +/- 2.61004e-10 - galCoeff: [0.7, 0.7, 0.7, 0.7, 0.7] - isoCoeff: [5.24455, 3.14799, 0.953585, 1.61143e-10, 0.557564] +/- [0.520857, 0.209865, 0.051445, 0.000108242, 0.000734453] - exposure(cm2s): 13670100.0 - exp-ratio: 0.0 - L_peak: 86.1236 - B_peak: -38.1824 - Distance from start pos: 0.0 - position: - L: -1.0 - B: -1.0 - Distance from start pos: -1.0 - radius of circle: -1.0 - ellipse: - a: -1.0 - b: -1.0 - phi: -1.0 -----------------------------------------------------------
ag.setOptions(energybins=[[100, 50000]])
ag.setOptions(galcoeff=[0.7])
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "index", False, show=False)
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "pos", True, show=True)
#selectedSources = ag.selectSources('flux > 0', show=True)
lightCurveData1 = ag.lightCurveMLE("2AGLJ2254+1609", tmin=55513.0, tmax=55517.0, timetype="MJD", binsize=86400)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 10.2859 * Free parameters: flux pos * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 2.69452e-05 +/- 1.31157e-06 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 8.75337e-06 +/- 1.62802e-06 - index: 2.51349 +/- 0.173183 - upper limit(ph/cm2s): 1.14728e-05 - ergLog(erg/cm2s): 1.40335e-09 +/- 2.61004e-10 - galCoeff: [0.7, 0.7, 0.7, 0.7, 0.7] - isoCoeff: [5.24455, 3.14799, 0.953585, 1.61143e-10, 0.557564] +/- [0.520857, 0.209865, 0.051445, 0.000108242, 0.000734453] - exposure(cm2s): 13670100.0 - exp-ratio: 0.0 - L_peak: 86.1236 - B_peak: -38.1824 - Distance from start pos: 0.0 - position: - L: -1.0 - B: -1.0 - Distance from start pos: -1.0 - radius of circle: -1.0 - ellipse: - a: -1.0 - b: -1.0 - phi: -1.0 ----------------------------------------------------------- Computing light curve bins..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
print(lightCurveData1)
ag.displayLightCurve("mle")
/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/lc/2/light_curve_216691200_217036800.txt Generating plot..please wait.
ag.setOptionTimeMJD(55517.0, 55521.0)
ag.setOptions(energybins=[[100, 300], [300, 1000], [1000, 3000], [3000, 10000], [10000, 50000]])
ag.setOptions(galcoeff=[0.7, 0.7, 0.7, 0.7, 0.7])
ag.setOptions(isocoeff=[-1, -1, -1, -1, -1])
maplistfile = ag.generateMaps()
Generating maps..please wait.
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "index", True, show=True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 10.2859 * Free parameters: flux index pos * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 2.69452e-05 +/- 1.31157e-06 - index: 2.20942 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 8.75337e-06 +/- 1.62802e-06 - index: 2.51349 +/- 0.173183 - upper limit(ph/cm2s): 1.14728e-05 - ergLog(erg/cm2s): 1.40335e-09 +/- 2.61004e-10 - galCoeff: [0.7, 0.7, 0.7, 0.7, 0.7] - isoCoeff: [5.24455, 3.14799, 0.953585, 1.61143e-10, 0.557564] +/- [0.520857, 0.209865, 0.051445, 0.000108242, 0.000734453] - exposure(cm2s): 13670100.0 - exp-ratio: 0.0 - L_peak: 86.1236 - B_peak: -38.1824 - Distance from start pos: 0.0 - position: - L: -1.0 - B: -1.0 - Distance from start pos: -1.0 - radius of circle: -1.0 - ellipse: - a: -1.0 - b: -1.0 - phi: -1.0 -----------------------------------------------------------
ag.mle()
['/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/mle/2/analysis_product_2AGLJ2254+1609.source']
selectedSources = ag.selectSources('flux > 0', show=True)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 35.0979 * Free parameters: flux index pos * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 8.75337e-06 +/- 1.62802e-06 - index: 2.51349 +/- 0.173183 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 4.31863e-05 +/- 2.43136e-06 - index: 2.07417 +/- 0.0530753 - upper limit(ph/cm2s): 4.7782e-05 - ergLog(erg/cm2s): 6.92366e-09 +/- 3.89797e-10 - galCoeff: [0.7, 0.7, 0.7, 0.7, 0.7] - isoCoeff: [5.49235, 3.58328, 0.434667, 0.0863388, 1.17445] +/- [0.38596, 0.208591, 0.0921842, 0.0461531, 0.0269097] - exposure(cm2s): 13201800.0 - exp-ratio: 0.0 - L_peak: 86.0861 - B_peak: -38.1857 - Distance from start pos: 0.0296635 - position: - L: 86.0523 - B: -38.1813 - Distance from start pos: 0.0560652 - radius of circle: 0.107995 - ellipse: - a: 0.105366 - b: 0.0989055 - phi: -0.371071 -----------------------------------------------------------
ag.setOptions(energybins=[[100, 50000]])
ag.setOptions(galcoeff=[0.7])
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "index", False, show=True)
affectedSources = ag.freeSources('name == "2AGLJ2254+1609"', "pos", True, show=True)
#selectedSources = ag.selectSources('flux > 0', show=True)
lightCurveData2 = ag.lightCurveMLE("2AGLJ2254+1609", tmin=55517.0, tmax=55521.0, timetype="MJD", binsize=86400)
----------------------------------------------------------- Source name: 2AGLJ2254+1609 (PointSource) => sqrt(ts): 35.0979 * Free parameters: flux pos * Initial source parameters: (PowerLaw) - flux(ph/cm2s): 8.75337e-06 +/- 1.62802e-06 - index: 2.51349 +/- 0.173183 - Source position: (86.1236, -38.1824) (l,b) - Distance from map center: 0.011 deg * Last MLE analysis: - flux(ph/cm2s): 4.31863e-05 +/- 2.43136e-06 - index: 2.07417 +/- 0.0530753 - upper limit(ph/cm2s): 4.7782e-05 - ergLog(erg/cm2s): 6.92366e-09 +/- 3.89797e-10 - galCoeff: [0.7, 0.7, 0.7, 0.7, 0.7] - isoCoeff: [5.49235, 3.58328, 0.434667, 0.0863388, 1.17445] +/- [0.38596, 0.208591, 0.0921842, 0.0461531, 0.0269097] - exposure(cm2s): 13201800.0 - exp-ratio: 0.0 - L_peak: 86.0861 - B_peak: -38.1857 - Distance from start pos: 0.0296635 - position: - L: 86.0523 - B: -38.1813 - Distance from start pos: 0.0560652 - radius of circle: 0.107995 - ellipse: - a: 0.105366 - b: 0.0989055 - phi: -0.371071 ----------------------------------------------------------- Computing light curve bins..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
Generating maps..please wait.
print(lightCurveData2)
ag.displayLightCurve("mle")
/Users/bulgarelli/agilepy_analysis/3C454_3_username_20210325-090417/lc/3/light_curve_217036800_217382400.txt Generating plot..please wait.
mergedfilename = "/tmp/lightcurve3C.txt"
! cat $lightCurveData1 > $mergedfilename
! sed '1d' $lightCurveData2 >> $mergedfilename
! cat $mergedfilename
time_start_mjd time_end_mjd sqrt(ts) flux flux_err flux_ul gal gal_error iso iso_error l_peak b_peak dist_peak l b r ell_dist a b phi exposure ExpRatio counts counts_err Index Index_Err Par2 Par2_Err Par3 Par3_Err Erglog Erglog_Err Erglog_UL time_start_utc time_end_utc time_start_tt time_end_tt Fix index ULConfidenceLevel SrcLocConfLevel start_l start_b start_flux typefun par2 par3 galmode2 galmode2fit isomode2 isomode2fit edpcor fluxcor integratortype expratioEval expratio_minthr expratio_maxthr expratio_size Emin emax fovmin fovmax albedo binsize expstep phasecode 55513.0 55514.0 4.32035 642.979e-08 232.549e-08 1180.75e-08 0.7 0.0 10.991 0.508972 85.9102 -37.9369 0.297486 86.2013 1.14284 1.08084 0.070285 0.887307 1.14284 28.7091 3364190.0 0.0 21.631 7.82338 2.51349 0.0 0.0 0.0 0.0 0.0 1.03083e-09 3.72824e-10 1.89299e-09 2010-11-13T00:00:00 2010-11-14T00:00:00 216691200.0 216777600.0 3.0 2.51349 2.0 5.99147 86.1236 -38.1824 8.75337e-06 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55514.0 55515.0 5.36336 786.759e-08 225.657e-08 1298.53e-08 0.7 0.0 5.54233 0.524938 85.5303 -37.8277 0.586852 85.2636 0.942056 1.19556 0.775149 1.35694 0.942056 14.5755 3535790.0 0.0 27.8182 7.97876 2.51349 0.0 0.0 0.0 0.0 0.0 1.26134e-09 3.61775e-10 2.08181e-09 2010-11-14T00:00:00 2010-11-15T00:00:00 216777600.0 216864000.0 3.0 2.51349 2.0 5.99147 86.1236 -38.1824 8.75337e-06 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55515.0 55516.0 5.3458 944.251e-08 270.486e-08 1553.45e-08 0.7 0.0 12.6982 0.516906 86.0458 -38.325 0.155178 86.3895 1.03513 1.02488 0.458339 0.896506 1.03513 63.9542 3417240.0 0.0 32.2673 9.24315 2.51349 0.0 0.0 0.0 0.0 0.0 1.51383e-09 4.33644e-10 2.4905e-09 2010-11-15T00:00:00 2010-11-16T00:00:00 216864000.0 216950400.0 3.0 2.51349 2.0 5.99147 86.1236 -38.1824 8.75337e-06 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55516.0 55517.0 5.46583 1003.54e-08 277.995e-08 1622.63e-08 0.7 0.0 13.2396 0.538426 86.427 -37.9296 0.347832 86.2991 0.941935 0.842048 0.375064 0.67343 0.941935 -15.1387 3559640.0 0.0 35.7223 9.89565 2.51349 0.0 0.0 0.0 0.0 0.0 1.60887e-09 4.45684e-10 2.60141e-09 2010-11-16T00:00:00 2010-11-17T00:00:00 216950400.0 217036800.0 3.0 2.51349 2.0 5.99147 86.1236 -38.1824 8.75337e-06 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55517.0 55518.0 13.1053 3734.56e-08 531.797e-08 4880.54e-08 0.7 0.0 6.19308 0.499734 86.2443 -38.083 0.180237 86.2404 0.389811 0.35359 0.185919 0.285663 0.389811 -57.8477 2163990.0 0.0 80.8154 11.508 2.07417 0.0 0.0 0.0 0.0 0.0 5.98727e-09 8.52581e-10 7.82451e-09 2010-11-17T00:00:00 2010-11-18T00:00:00 217036800.0 217123200.0 3.0 2.07417 2.0 5.99147 86.0523 -38.1813 4.31863e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55518.0 55519.0 19.1765 4671.24e-08 427.689e-08 5570.3e-08 0.7 0.0 6.39232 0.437733 86.0691 -38.2228 0.0435774 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 3811480.0 0.0 178.043 16.3013 2.07417 0.0 0.0 0.0 0.0 0.0 7.48896e-09 6.85673e-10 8.93034e-09 2010-11-18T00:00:00 2010-11-19T00:00:00 217123200.0 217209600.0 3.0 2.07417 2.0 5.99147 86.0523 -38.1813 4.31863e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55519.0 55520.0 18.5179 4495.2e-08 443.194e-08 5429.81e-08 0.7 0.0 15.9092 0.433656 85.9694 -38.2509 0.0952737 85.9187 0.199233 0.250303 0.13197 0.278425 0.199233 -10.5195 3713430.0 0.0 166.926 16.4577 2.07417 0.0 0.0 0.0 0.0 0.0 7.20674e-09 7.10532e-10 8.70511e-09 2010-11-19T00:00:00 2010-11-20T00:00:00 217209600.0 217296000.0 3.0 2.07417 2.0 5.99147 86.0523 -38.1813 4.31863e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0 55520.0 55521.0 19.3112 4666.6e-08 448.349e-08 5612.13e-08 0.7 0.0 7.7854 0.425711 86.1123 -38.1832 0.0472324 86.1232 0.214027 0.233755 0.0564037 0.22862 0.214027 -10.6023 3475880.0 0.0 162.205 15.5841 2.07417 0.0 0.0 0.0 0.0 0.0 7.48152e-09 7.18797e-10 8.9974e-09 2010-11-20T00:00:00 2010-11-21T00:00:00 217296000.0 217382400.0 3.0 2.07417 2.0 5.99147 86.0523 -38.1813 4.31863e-05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.75 0.0 1.0 1.0 0.0 15.0 10.0 100.0 50000.0 0.0 60.0 80.0 0.5 0.0 6.0
ag.displayLightCurve("mle", filename=mergedfilename)
Generating plot..please wait.
time_start_mjd time_end_mjd sqrt(ts) flux flux_err flux_ul gal gal_error iso iso_error l_peak b_peak dist_peak l b r ell_dist a b phi exposure ExpRatio counts counts_err Index Index_Err Par2 Par2_Err Par3 Par3_Err Erglog Erglog_Err Erglog_UL time_start_utc time_end_utc time_start_tt time_end_tt Fix index ULConfidenceLevel SrcLocConfLevel start_l start_b start_flux typefun par2 par3 galmode2 galmode2fit isomode2 isomode2fit edpcor fluxcor integratortype expratioEval expratio_minthr expratio_maxthr expratio_size Emin emax fovmin fovmax albedo binsize expstep phasecode
ag.displayGenericColumn(mergedfilename, "exposure", um="cm^2 s sr")
ag.deleteAnalysisDir()
False